﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exercise4
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一个正整数:");
            int number = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine($"{number} = ");

            if (number <= 1)
            {
                Console.WriteLine("输入错误，请输入大于1的正整数。");
                return;
            }

            int k = 2; // 最小的质数

            while (number >= k)
            {
                if (number % k == 0)
                {
                    Console.Write($"{k}");
                    number = number / k;

                    if (number != 1)
                    {
                        Console.Write(" * ");
                    }
                }
                else
                {
                    k++;
                }
            }

            Console.WriteLine();
        }
    }
}
